<template>
  <div class="container">
    <van-tabs v-model="active">
      <van-tab title="支部">
        <list :list="deptRankList" />
      </van-tab>
      <van-tab title="机关小组">
        <list :list="deptGroupRankList" />
      </van-tab>
    </van-tabs>
  </div>
</template>
<script>
import List from './list'
import Ranking from '@/components/ranking'

export default {
  components: {
    List,
    Ranking
  },
  data () {
    return {
      active: 0,
      deptRankList: [],
      deptGroupRankList: []
    }
  },
  created () {
    this.getRanking()
  },
  methods: {
    getRanking () {
      // 支部排行 deptRank
      this.$axios.get('/xbkj-dj/web/rank/deptRank').then(res => {
        console.log(res)
        this.deptRankList = res.rankList
      })
      // 机关小组排行 deptGroupRank
      this.$axios.get('/xbkj-dj/web/rank/deptGroupRank').then(res => {
        console.log(res)
        this.deptGroupRankList = res.rankList
      })
    }
  }
}
</script>
<style lang="less" scoped>

</style>
